package com.china08.yxyapi.repository.db;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import com.china08.yxyapi.entity.db.yxy.YxyQuesKnow;

public interface YxyQuesKnowRepository extends JpaRepository<YxyQuesKnow, Integer> {

    List<YxyQuesKnow> findByStageAndSubjectAndDeleteFlag(String stage, String subject, String deleteFlag);

    List<YxyQuesKnow> findByStageAndSubjectAndDeleteFlagOrderByOrderNumAsc(String stage, String subject,
            String deleteFlag);

    List<YxyQuesKnow> findByStageAndSubjectAndDeleteFlagAndParentId(String stage, String subject, String deleteFlag,
            Integer parentId);

    List<YxyQuesKnow> findByStageAndSubjectAndDeleteFlagAndTypeAndNameContaining(String stage, String subject,
            String deleteFlag, String type, String name);

    List<YxyQuesKnow> findByIdIn(List<Integer> knowIds);

    @Query(value = "select id  from YxyQuesKnow where parentId in ?1")
    List<Integer> findTocIdByParentTocId(List<Integer> parentTocId);

    YxyQuesKnow findById(Integer id);

    List<YxyQuesKnow> findByIsUpdate(int i);

    List<YxyQuesKnow> findByParentId(Integer knowId);

    List<YxyQuesKnow> findByParentIdIn(List<Integer> knowIds);

}
